

GCC = gcc
CFLAGS = -O -Wall -Wshadow  # use -g replace -o
VALGRIND = valgrind --tool=memcheck --verbose --log-file

test0:prog
	./prog inputs/input0 > outputs/output0
	diff expected/expected0 outputs/output0
	$(VALGRIND)=log0 ./prog inputs/input0 >/dev/null &

prog:aredistinct.o main.o
	$(GCC) $(CFLAGS) aredistinct.o main.o -o prog

aredistinct.o:aredistinct.c
	$(GCC) $(CFLAGS) -c aredistinct.c

main.o:main.c
	$(GCC) $(CFLAGS) -c main.c

clean:
	rm -rf *.o prog outputs/*
